
file(GLOB_RECURSE _files
    *.h
    *.c
    *.cpp
    *.hlsl
)

file(GLOB_RECURSE _shaders
    *.hlsl
)

# list(FILTER sources EXCLUDE REGEX "^${CMAKE_CURRENT_SOURCE_DIR}/CMakeFiles")

# target_include_directories(selahengine PRIVATE ./)
# target_include_directories(selahengine PRIVATE ./External/imgui/)

# /*$(if:DX12.AgilitySDKRequired:true)*/target_include_directories(selahengine PRIVATE ./AgilitySDK/include/)/*$(endif)*/

set(_exec HelloTriangle)
# add_executable(${_exec})
# target_sources(${_exec} PUBLIC ${_files})

add_executable(${_exec} WIN32 ${_files})
target_compile_features(${_exec} PRIVATE cxx_std_17)
target_compile_definitions(${_exec} PRIVATE "UNICODE" "_UNICODE")
target_link_libraries(${_exec} d3d12.lib dxgi.lib d3dcompiler.lib)

target_precompile_headers(${_exec} PUBLIC "stdafx.h")

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${_files})

# set_source_files_properties(${_shaders} PROPERTIES HEADER_FILE_ONLY TRUE)

# set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT selahengine)


add_custom_command(
    TARGET ${_exec}
    POST_BUILD
    COMMAND "${CMAKE_COMMAND}" -E copy ${_shaders} $<TARGET_FILE_DIR:${_exec}>
)